<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8" />
    <meta content="initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <title>一款超好用的微商营销赚钱软件</title>
    <meta content="微手" name="keywords" />
    <meta content="一款超好用的微商软件" name="description" />
    <script src="{:_static()}/single/js/jquery-1.8.0.min.js"></script>
    <script src="{:_static()}/single/js/js.cookie.min.js"></script>
    <script src="{:_static()}/single/js/ua-parser.min.js"></script>
    <style type="text/css">
    * {
        margin: 0;
        padding: 0;
        -webkit-user-select: none;
        -moz-user-select: none;
        -o-user-select: none;
        user-select: none;
    }

    .hr {
        width: 79%;
        margin: 0 auto;
        margin-bottom: 15px;
    }

    .container {
        width: 100%;
        margin: 0 auto;
        text-align: center;
    }

    .container .wechat {
        display: block;
        width: 100%;
        position: relative;
        margin: 0 auto;
        padding-bottom: 40px;
    }

    .head_text {
        position: absolute;
        top: 40px;
        width: 100%;
    }

    .head_text .title {
        color: #fff;
        font-size: 10vw;
        font-weight: bolder;
        letter-spacing: 2px;
    }

    .head_text .subTitle {
        color: #fff;
        font-size: 5vw;
        letter-spacing: 1px;
        margin-top: 3%;
    }

    .cover {
        position: fixed;
        top: 0;
        left: 0;
        background: rgba(0, 0, 0, 0.7);
        z-index: 5;
        width: 100%;
        height: 100%;
        display: none;
    }

    .rt_guide {
        position: absolute;
        top: 10px;
        right: 25px;
        width: 70%;
        z-index: 6;
        display: none;
    }

    .container img {
        display: block;
        width: 100%;
        height: auto;
    }

    .container .invitation {
        position: relative;
    }

    .container .invitation .money {
        display: none;
    }

    .container .rules {
        position: relative;
    }

    .container .rules .rules_content {
        margin-top: 3px;
        position: absolute;
        bottom: 15px;
        left: 0;
    }

    .container .rules .rules_content p {
        float: left;
        text-align: left;
        margin: 0 30px;
        font-size: 0.8em;
        line-height: 150%;
        color: white;
    }

    .container .invitation {}

    .container .invitation .title {
        margin-top: -1px;
        /*background: #FFC324;*/
        font-size: 14px;
        width: 100%;
        line-height: 32px;
        color: #403C32;
    }

    .container .input_box {
        position: relative;
        background: #FFF;
        width: 80%;
        margin: 0 auto;
        padding: 15px 30px;
        box-sizing: border-box;
        border-radius: 10px;
        border-width: 1px;
        box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.2);
    }

    .container .input_box .title span {
        font-size: 18px;
        color: #fa6022;
        width: 100%;
    }

    .container .input_box .title p {
        color: #999999;
        margin: 8px;
    }

    .receive {
        margin-top: -100px;
        width: 100%;
        position: absolute;
        top: 260px;
        bottom: 0;
        left: 0;
    }

    .receive_image {
        position: relative;
        background-image: url('{:_static()}/single/images/bg_input.png');
        background-repeat: no-repeat;
        background-position-x: center;
        background-position-y: center;
        background-size: 90% 90%;
    }

    .container .invitation .input_box input {
        outline: none;
        width: 97%;
        display: block;
        text-align: center;
        border: 1px solid #EEEEEE;
        box-sizing: border-box;
        background: #EEEEEE;
        color: #403C32;
        font-size: 15px;
        height: 33px;
        line-height: 33px;
        margin: 15px auto;
        border-radius: 18px;
        -webkit-user-select: auto;
        -moz-user-select: auto;
        padding-left: 10px;
        -o-user-select: auto;
        user-select: auto;
    }

    .wechat button {
        margin-top: -30px;
        border-radius: 30px;
        border-width: 0px;
        background: #FFC000;
        height: 45px;
        width: 70%;
        color: #FFF;
        font-size: 21px;
        box-shadow: 0px 8px 15px rgba(0, 0, 0, 0.2);
    }

    .container .invitation .downloadApp {
        margin-top: -30px;
    }

    .container .invitation_success .downloadApp {
        vertical-align: middle;
        text-align: center;
    }

    .container .invitation_success .downloadApp img {
        width: 70%;
        margin-left: 15%;
    }

    .container .wx_downloadAPP {
        position: relative;
        vertical-align: middle;
        text-align: center;
    }

    .container .wx_downloadAPP .downloadAPP img {
        margin-top: -80px;
        width: 100%;
        position: absolute;
        width: 86%;
        margin-left: 7%;
    }

    .container .invitation_success .downloadApp p {
        margin-top: 10px;
        color: #a5783e;
        font-size: 13px;
    }

    .container .invitation .input_box input::-webkit-input-placeholder {
        color: #ADAAA4;
    }

    .container .invitation .input_box input:-ms-input-placeholder {
        color: #ADAAA4;
    }

    .container .invitation .input_box input:-moz-placeholder {
        color: #ADAAA4;
    }

    .container .invitation .input_box input::-moz-placeholder {
        color: #ADAAA4;
    }

    .container .invitation .input_box button.disable {
        background: #bababa;
        color: #FFF;
    }

    .container .invitation .input_box button {
        position: relative;
        outline: none;
        width: 100%;
        display: block;
        text-align: center;
        background: #5DB2FB;
        color: #FFF0EF;
        font-size: 21px;
        height: 40px;
        line-height: 40px;
        margin: 10px auto;
        border: 0 none;
        box-sizing: border-box;
        border-radius: 5px;
    }

    .hr_line {
        height: 5px;
        border: none;
        border-top: 2px solid #fa6022;
        width: 3vh;
        display: inline-block;
        background-image: url('{:_static()}/single/images/coupon_head.png');
    }

    .bottom {
        margin-top: 20px;
        text-align: center;
        width: 100%;
    }

    .text-hr {
        display: -webkit-box;
        display: -moz-box;
        display: box;
        display: -webkit-flex;
        display: -moz-flex;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -moz-box-align: center;
        box-align: center;
        -webkit-align-items: center;
        -moz-align-items: center;
        -ms-align-items: center;
        -o-align-items: center;
        align-items: center;
        -ms-flex-align: center;
        font-family: sans-serif;
        width: 80%;
        margin: 0 auto;
        color: #444;
    }

    .text-hr-content {
        padding-right: 15px;
    }

    .text-hr-content:not(:first-child) {
        display: none;
    }

    .text-hr::after {
        -webkit-box-flex: 1;
        -moz-box-flex: 1;
        box-flex: 1;
        -webkit-flex: 1;
        -moz-flex: 1;
        -ms-flex: 1;
        flex: 1;
        background: #c7c7c7;
        content: '';
        height: 1px;
    }

    .text-hr-center::before {
        -webkit-box-flex: 1;
        -moz-box-flex: 1;
        box-flex: 1;
        -webkit-flex: 1;
        -moz-flex: 1;
        -ms-flex: 1;
        flex: 1;
        background: #c7c7c7;
        content: '';
        height: 1px;
    }

    .text-hr-center .text-hr-content {
        padding: 0 15px;
    }
    </style>

    <body>
        <div class="container">
            <div class="invitation">
                <img src="{:_static()}/single/images/head.png" />
                <div class="receive">
                    <div id="input_box" class="input_box">
                        <div class="title">
                            <img src="{:_static()}/single/images/coupon_head.png" />
                            <p>来自好友的邀请</p>
                        </div>
                        <input maxlength="11" placeholder="请输入手机号领优惠券" />
                        <img id="takeCoupon" src="{:_static()}/single/images/btn_02.png" />
                    </div>
                </div>
            </div>
            <div class="invitation_success" style="display:none;">
                <img src="{:_static()}/single/images/success.png" />
                <div class="downloadApp">
                    <img src="{:_static()}/single/images/btn_01.png" />
                    <p id="return_text"></p>
                </div>
                <img src="{:_static()}/single/images/coupon.png" />
            </div>
            <div class="bottom">
                <img id="bottom-img" src="{:_static()}/single/images/feature.png" />
            </div>
            <div class="wx_downloadAPP" style="display:none;">
                <img src="{:_static()}/single/images/desc.png" />
                <div class="downloadAPP">
                    <img src="{:_static()}/single/images/btn_01.png" />
                </div>
            </div>
            <div class="rules">
                <img id="bottom-img" src="{:_static()}/single/images/rule.png" />
                <div class="rules_content">
                    <p>1.仅限2017年8月1日起注册的新用户参与。</p>
                    <p>2.每个手机号限领一次。</p>
                    <p>3.优惠券有效期7天，从领取之日开始计算，超过有效期无法使用</p>
                </div>
            </div>
            <div class="cover"></div>
            <div class="rt_guide">
                <img src="{:_static()}/single/images/cover.png" />
            </div>
        </div>
        <script type="text/javascript">
        var parser = new UAParser();
        var browserName = parser.getBrowser().name;
        var osName = parser.getOS().name;

        // 微信场景的判断
        var isWX = false;
        var isQQ = false;
        if (browserName.toLowerCase() == 'wechat') {
            isWX = true;
        }
        if (navigator.userAgent.toLowerCase().match(/QQ/i) == "qq" && browserName.toLowerCase() != 'qqbrowser') {
            isQQ = true;
        }

        var titleInit = '来自好友187****8293的邀请';

        var submitted = Cookies.getJSON('submitted');
        var submittedPhoneList = [];
        if (undefined != submitted) {
            submittedPhoneList = submitted.phones;
        }
        $(document).ready(function() {

            //绑定shade页面上图片的事件
            if (isWX || isQQ) {
                $(".wx_downloadAPP").show();
                $(".invitation").css({ display: "none" });
                $(".invitation_success").css({ display: "none" });
                $(".bottom").css({ display: "none" });
                $(".rules").css({ display: "none" });
                $(".container").on("click", ".wx_downloadAPP", function() {
                    if (osName == 'iOS') {
                        alert("因iOS系统限制，米客小蜜不支持iPhone，请用安卓手机下载安装。");
                        return;
                    }
                    $(".rt_guide").show();
                    $(".cover").show();
                });
            } else {
                $(".shade").hide();
                $(".invitation").show();

                if (false == true) {
                    alert("邀请地址已失效。");
                }
                if (submittedPhoneList.length >= 3) {
                    $(".input_box").find("input").hide();
                    var lastPhoneNumber = submittedPhoneList[submittedPhoneList.length - 1];
                }
            }

            //绑定shade页面上弹出层图片的事件
            $(".container").on("click", ".cover", function() {
                if (!$(this).is(":hidden")) {
                    $(this).hide();
                    $(".rt_guide").css({ display: "none" });
                }
            });

            $(".container").on("click", ".rt_guide", function() {
                if (!$(this).is(":hidden")) {
                    $(this).hide();
                    $(".cover").css({ display: "none" });
                }
            });

            //绑定input 输入框的事件
            $(".input_box").on("input", "input", function(event) {
                var __phone = $(this).val();
                if (__phone.length == 11) {
                    if (!(/^1[^1^2]\d{9}$/.test(__phone))) {
                        alert("手机号码格式有误，请重填");
                        $(this).val("");
                    } else {
                        $(".invitation").find('.title').html(titleInit);
                    }
                } else {
                    $(".invitation").find('.title').html(titleInit);
                }

            });

            $(".input_box").on("click", "img", function(event) {
                var __phone = $(".input_box").find("input").val();
                if (__phone == "" || __phone.trim() == "") {
                    alert("请输入手机号码");
                    $(this).val("");
                    return;
                }
                if (__phone.length != 11 || !(/^1[^1^2]\d{9}$/.test(__phone))) {
                    alert("手机号码格式有误，请重填");
                    $(".input_box").find("input").val("");
                    return;
                }
                var phoneNumber = $(".input_box").find("input").val();
                $.ajax({
                    type: "POST",
                    data: JSON.stringify({ phoneNumber: phoneNumber }),
                    contentType: "application/json",
                }).done(function(data) {
                    if (data.code == 200) {
                        $(".invitation").css({ display: "none" });
                        $(".invitation_success").show();
                        $("#return_text").html(data.msg);

                        submittedPhoneList.push(phoneNumber);
                        Cookies.set('submitted', { phones: submittedPhoneList }, { expires: 1 });
                        window.location.href = "wsxm.yq.apk";
                    } else {
                        alert(data.msg);
                        window.location.href = "wsxm.yq.apk";
                    }

                });

            });


            $(".downloadApp").on("click", "img", function(event) {
                window.location.href = "wsxm.yq.apk";
            });
            $(".invitation_success").on("click", "img", function(event) {
                window.location.href = "wsxm.yq.apk";
            });

        });
        </script>
    </body>

</html>